/**
 *	流程模块接口文件：flowlog单据操作记录
 *	开发者：雨中磐石
 *	地址：www.rockoa.com
 *	日期：2023-07-19
 */

package com.framework.Module.flow.flowlog;




import com.framerock.baselib.Patter;
import com.framerock.baselib.Rock;
import com.framework.Flow.FlowListener;
import com.framework.Model.ModelUsera;

import java.util.Map;


public class FlowListenerflowlog extends FlowListener {



    @Override
    public Map<String, String> onDatabefore() {
        Map<String,String> da = Rock.getMap();
        String where = "1=2";
        where = "";
        String table = mRequest.get("table");
        String mid   = mRequest.get("mid");
        if(!Rock.isEmpt(table) && !Rock.isEmpt(mid) && Patter.iszgen(table) && Patter.isnumber(mid)){
            where = "`table`='"+table+"' AND `mid`="+mid+"";
        }
        da.put("where", where);
        return da;
    }

    @Override
    public Boolean onisAdd() {
        return false;
    }


    @Override
    public Map<String, String> onReplacers(Map<String, String> da, int lx) {
        int checkid = Rock.getMapint(da, "checkid");
        String face = "";
        if(checkid > 0) {
            face = mFlow.modelUsera.getFace(checkid+"");
        }
        da.put("face", face);
        da.put("isrowhui", "0");
        return da;
    }
}
